#!/usr/bin/env bash

channel="$1"

query=""
case $channel in
  stable)
    ;;
  preview)
    query="&preview=1"
    ;;
  nightly)
    query="&nightly=1"
    ;;
  *)
    echo "this must be run on either of stable|preview|nightly release branches" >&2
    exit 1
    ;;
esac

curl -s "https://cloud.zed.dev/releases/$channel/latest/asset?asset=zed&os=macos&arch=aarch64" | jq -r .version
